<?php


use App\Http\Admin\Controller\CommonController;
use Sc\Util\HtmlStructure\Form;
use Sc\Util\HtmlStructure\Html\Html;

Html::create('表单-上传型');

$form = Form::create("demo14Form")->config(['label-width' => '80px']);

$form->addFormItems(
    Form\FormItem::upload('avatar', '头像')
        ->setUploadUrl(sc_route([CommonController::class, 'upload']))->toImage(),
    Form\FormItem::upload('photos', '相册')
        ->setUploadUrl(sc_route([CommonController::class, 'upload']))->toImage(true),
    Form\FormItem::upload('file', '文件')
        ->setUploadUrl(sc_route([CommonController::class, 'upload']))
        ->multiple()
        ->showProgress(),
);


return $form->render();
